package common;

import java.io.Serializable;
import java.util.ArrayList;

public class MessageHandle implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2592827873820395192L;

	public enum MessageType
	{
		SYSTEM, GLOBAL, PRIVATE
	};

	private int targetClientID = -1; // Default value is -1
	private MessageType msType = MessageType.GLOBAL; // Default value is COMMON
	private String ownerName;
	private String message;
	private ArrayList<User> listOnline = new ArrayList<>();

	public MessageHandle(String ownerName) {
		this.ownerName = ownerName;
		this.message = getOwner();
	}

	public String getMessage() {
		return message;
	}

	public String getOwner() {
		return ownerName;
	}

	public int getTargetClientID() {
		return targetClientID;
	}

	public void setMessage(String text) {
		this.message = text;
	}

	public void setTargetClientID(int targetClientID) {
		this.targetClientID = targetClientID;
	}

	public MessageType getMsType() {
		return msType;
	}

	public void setMsType(MessageType msType) {
		this.msType = msType;
	}

	public ArrayList<User> getListOnline() {
		return listOnline;
	}

	public void setListOnline(ArrayList<User> listOnline) {
		this.listOnline = listOnline;
	}
}
